﻿/**
 * Proyecto: Cognitum
 * Global IT Services 2008
 * @author Esanantonio
 */
Cognitum.Polizas.DirectorAsociado.Entity = function(){
    if (LOG.isDebugEnabled()) {
        LOG.debug('[DirectorAsociado.Entity.ctor] <-');
    }
    Cognitum.Polizas.DirectorAsociado.Entity.superclass.constructor.call(this);
}

Ext.extend(Cognitum.Polizas.DirectorAsociado.Entity, Karma.Core.Entity, {
    id: 'DirectorAsociado.Entity',
    name: 'DirectorAsociado',
    editorXType: 'dir.asoc.editor',
    columns: [{
        Name: 'Id',
        Property: 'Id',
        Mostrar: false
    }, {
        Name: 'Nombre',
        Property: 'Nombre'
    }],
    aggregatelist: {
    
        getTBarControls: function(){
            return [{
                xtype: 'button',
                text: 'Agregar...',
                handler: this.newRecord,
                scope: this,
                hidden: !(this.canNew && this.security.New)
            }, {
                xtype: 'button',
                text: 'Eliminar',
                handler: function(){
                    var selected = this.grid.getSelectionModel().getSelected();
                    this.deleteRecord(selected.data.Id);
                },
                scope: this,
                hidden: !(this.canDelete && this.security.Delete)
            }];
        }
    },
    searchlist: {
        sortings: ["Id"],
        views: [{
            Id: 0,
            Nombre: 'Normal',
            Template: null
        }, {
            Id: 1,
            Nombre: 'Expandida',
            Template: null
        }],
        previewTemplate: null
    },
    link: {
        displayProperty: 'Nombre'
    
    }
});

Cognitum.DirectoresAsociados = Cognitum.Polizas.DirectorAsociado.Entity;
